package com.boot_reggie.Service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.boot_reggie.Dao.CategoryMapper;
import com.boot_reggie.Service.CateService;
import com.boot_reggie.common.CustomException;
import com.boot_reggie.domain.Category;
import com.boot_reggie.domain.Dish;
import com.boot_reggie.domain.Employee;
import com.boot_reggie.domain.Setmeal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CateServiceimpl extends ServiceImpl<CategoryMapper,Category> implements CateService {
    @Autowired
    private CategoryMapper categoryMapper;


    @Override
    public IPage<Category> getPage(IPage page) {
        LambdaQueryWrapper<Category> lambdaQueryWrapper = new LambdaQueryWrapper();
        lambdaQueryWrapper.select(Category::getName,Category::getSort,Category::getUpdateTime,Category::getType,Category::getId);
        lambdaQueryWrapper.orderByAsc(Category::getSort);
        return categoryMapper.selectPage(page,lambdaQueryWrapper);
    }

    @Override
    public boolean delData(Category category) {

        return true;
    }

}
